package com.atguigu.gmall.feign.search;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.search.Goods;
import com.atguigu.gmall.search.vo.SearchParamVo;
import com.atguigu.gmall.search.vo.SearchResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/api/inner/search")
@FeignClient("service-search")
public interface SearchFeignClient {


//   检索

    @PostMapping("/search")
    Result<SearchResultVo> search(@RequestBody SearchParamVo searchParam);


//    保存 商品数据 到 ES

    @PostMapping("/save")
    Result saveGoods(@RequestBody Goods goods);


    /**
     * 商品下架
     * @param skuId
     * @return
     */
    @DeleteMapping("/goods/{skuId}")
    Result delete(@PathVariable("skuId") Long skuId);
}
